package com.whtq.api.oauth2;

import org.apache.shiro.authc.RememberMeAuthenticationToken;

/**
 * Created by
 *
 * @author wmi
 * @date 2021/9/15 - 15:58.
 * @description
 */
public class OAuth2Token implements RememberMeAuthenticationToken {
    private String accessToken;

    private String userName;

    private boolean rememberMe = false;

    public OAuth2Token(String accessToken){
        this.accessToken = accessToken;
    }

    public OAuth2Token(String userName,String accessToken){
        this.userName = userName;
        this.accessToken = accessToken;
    }

    @Override
    public String getPrincipal() {
        return userName;
    }

    @Override
    public Object getCredentials() {
        return accessToken;
    }

    @Override
    public boolean isRememberMe() {
        return rememberMe;
    }
}
